import { _decorator, Component, randomRangeInt, Scene, tween, Vec3 } from 'cc';
const { ccclass } = _decorator;
@ccclass('runs2')
export class runs2 extends Component {
    myTween: any;
    start() {
        this.startgame();
    }

    startgame() {
        const go = () => {
            this.myTween = tween(this.node)
                .by(3, { position: new Vec3(-1200, 0, 0) })
                .by(0.0001, { position: new Vec3(1200, 0, 0) })
                .call(() => {
                    // 继续播放 Tween 动画
                    this.myTween.start();
                    go();

                })
                .start();
        }
        go();
    }
    

}

